/**
 * Created by baowei on 2018/10/17.
 */
import Request from "../../../utils/request";
export default class {
  // 获取优惠券列表
  static getCouponsList(params, pageType) {
    console.log(pageType);
    let url = pageType == 'index' ? 'app/coupons/config/list' : 'app/coupons/list';
    let type = pageType == 'index' ? 'GET' : 'POST';
    return Request({
      "url": url,
      type: type,
      data: params,
    })
  }
  //领取优惠券
  static receiveCoupon(params) {
    return Request({
      "url": "app/coupons/create",
      type: "POST",
      data: params,
      headers: {
        "Content-type": "application/json"
      },
    })
  }
}
